import { createApp } from 'vue';
import App from './App.vue';
import VueViewer from 'v-viewer';
// class
import '@/styles/index.scss';
// 打印
import Print from 'vue3-print-nb';
// svg icons
import 'virtual:svg-icons-register';
// element plus
import ElementPlus from 'element-plus';
// element icons
import * as Icons from '@element-plus/icons-vue';
// custom directives
import directives from '@/directives/index';
// vue Router
import router from '@/routers';
// vue i18n
import I18n from '@/languages/index';
// pinia store
import pinia from '@/stores';

import datav from '@iamzzg/data-view/dist/vue3/datav.map.vue.esm';

// errorHandler
// import errorHandler from "@/utils/errorHandler";

// import "default-passive-events";

const app = createApp(App);

// app.config.errorHandler = errorHandler;

// register the element Icons component
Object.keys(Icons).forEach(key => {
  app.component(key, Icons[key as keyof typeof Icons]);
});

app.use(ElementPlus).use(directives).use(router).use(I18n).use(pinia).use(VueViewer).use(datav).use(Print).mount('#app');
